package cn.snoworld.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;
import java.util.List;

@Data
@NoArgsConstructor
@AllArgsConstructor
@TableName("article")
@ApiModel(value = "文章", description = "博客文章")
public class Article {
    @TableId(type = IdType.AUTO)
    @ApiModelProperty("文章ID")
    private Integer id;

    @ApiModelProperty("文章标题")
    private String title;

    @ApiModelProperty("文章浏览量")
    private int view;

    @ApiModelProperty("文章摘要")
    private String summary;

    @ApiModelProperty("文章封面图片（地址）")
    private String cover;

    @ApiModelProperty("文章作者")
    private String author;

    @TableField(value = "gmt_create", fill = FieldFill.INSERT)
    @JsonIgnore
    private LocalDateTime creationTime;

    @TableField(value = "gmt_modified", fill = FieldFill.INSERT_UPDATE)
    @JsonIgnore
    private LocalDateTime modificationTime;

    @TableField(exist = false)
    @ApiModelProperty("文章内容")
    private String content;

    // @TableField(exist = false)
    // @ApiModelProperty("评论列表")
    // private List<Comment> commentList;
}
